require.config({
    paths: {
        angular: '../../../../lib/angularjs/1.3.0-beta.5/angular',
        angularRoute: '../../../../lib/angularjs/1.3.0-beta.5/angular-route',
        angularMocks: '../../../../lib/angularjs/1.3.0-beta.5/angular-mocks',
        bootstrap: '../../../../lib/bootstrap/3.1.1/js/bootstrap',
        jQuery: '../../../../lib/jquery/1.11.0/jquery'
    },
    baseUrl: 'app/js',
    shim: {
        'angular': {'exports': 'angular'},
        'angularRoute': ['angular'],
        'angularMocks': {
            deps: ['angular'],
            'exports': 'angular.mock'
        },
        'bootstrap': ['jQuery']
    },
    priority: [
        "angular"
    ]
});

// manually bootstrap the app
window.name = "NG_DEFER_BOOTSTRAP!";

require([
    'angular',
    'app',
    'routes',
    'bootstrap'
], function (angular, app, routes) {
    'use strict';
    var $html = angular.element(document.getElementsByTagName('html')[0]);

    angular.element().ready(function () {
        $html.addClass('ng-app');
        angular.bootstrap($html, [app['name']]);
    });
});
